package crm.copy;

import java.util.Scanner;
/**
 * 控制台服务启动类
 * @author ZHUAN4
 *
 */
public class Start {

	public void start(DataHand<CustomerT> dh,CommandHandle cd,DealCommand dc,String command,String commandKind){
		dh.initCRM(InitialData.initialData());
		/**
		 * 初始界面
		 */
		System.out.println("····················································");
		System.out.println("·            Wlecome to oocl CRM!                  ·");
		System.out.println("·                input 'HELP' to see help document!·");
		System.out.println("····················································");
		System.out.println();
		Scanner input=new Scanner(System.in);
		do{
			System.out.println("·············Please input your command··············");
			command="";
		    commandKind="";
		    command=input.nextLine();
		    commandKind=cd.commandHandle(command);   //调用命令解析器，来解析代码
		    String[] strCommand=command.split(" ");
		    dc.dealCommand(dh, commandKind, strCommand, input);
		}while(true);
	}
}
